package com.sl.diary.adapter;

import java.util.List;

import com.sl.diary.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageButton;

public class HorizontalListViewAdapter extends BaseAdapter {
	
	private Context context;
	private List plotsImages;
	private static ViewHolder holder;
	
	public HorizontalListViewAdapter(Context context, List plotsImages) {
		this.context = context;
		this.plotsImages = plotsImages;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return plotsImages.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if(convertView == null) {
			holder = new ViewHolder();
			
			convertView = LayoutInflater.from(context).inflate(R.layout.horizontal_list_item, null);
			holder.imageView = (ImageButton) convertView.findViewById(R.id.image_item);
			
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		
		return convertView;
	}
	
	private static class ViewHolder {
		ImageButton imageView;
	}

}
